<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>菜单管理--${fns:getConfig('productName')}</title>
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#category").focus();
				$("#inputForm")
						.validate(
								{
									rules : {
										tag:{
											remote:"${ctx}/systemMenu/checkTag.do?oldTag=" + encodeURIComponent("${sysmenu.tag}"),
										}
									},
									messages : {
										tag: {remote: "标签已存在"},
									},
									submitHandler : function(form) {
										loading('正在提交，请稍等...');
										form.submit();
									},
									errorPlacement : function(error, element) {
										if (element.is(":checkbox")
												|| element.is(":radio")
												|| element.parent().is(
														".input-append")) {
											error.appendTo(element.parent()
													.parent());
										} else {
											error.insertAfter(element);
										}
									}
								});
			});
</script>
</head>
<body>
	<ul class="nav nav-tabs" style="margin:0 4px;margin-bottom:15px;">
		<li><a href="${ctx}/systemMenu/list.do?type=1&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}"> <i
				class="icon icon-list"></i>&nbsp;<span>公路监管菜单列表</span>
		</a></li>
		<sec:authorize ifAnyGranted="ROLE_sys_menu_edit">
		<li class="active"><a
			href="${ctx}/systemMenu/input.do?type=1&id=${fns:encodeParam(sysmenu.id)}&parent.id=${fns:encodeParam(sysmenu.parent.id)}&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}">
				<i class="icon icon-edit"></i>&nbsp;<span>菜单${not empty sysmenu.id?'修改':'添加'}</span>
		</a></li>
		</sec:authorize>
	</ul>
	<br />

	<form id="inputForm"  action="${ctx}/systemMenu/save.do?type=1&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}" method="post"
		style="overflow: auto;width:auto;" class="propertyHeight form-horizontal">
		<input type="hidden" name="token" value="${token}">
		<input type="hidden" name="id" value="${sysmenu.id}">
		<input type="hidden" name="system" value="1">
		<div class="control-group">
			<label class="control-label">上级菜单<font style="color:red;">*</font>:</label>
			<div class="controls">
				<tags:treeselect id="menu" name="parentId"
					value="${sysmenu.parent.id}" labelName="parentName"
					labelValue="${sysmenu.parent.name}" title="菜单"
					url="/systemMenu/treeData.do?type=1" extId="${sysmenu.id}"
					cssClass="required" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">名称<font style="color:red;">*</font>:</label>
			<div class="controls">
				<input type="text" name="name" class="required"
					value="${sysmenu.name}" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">链接:</label>
			<div class="controls">
				<input type="text" name="href" value="${sysmenu.href}" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">国省检链接:</label>
			<div class="controls">
				<input type="text" name="checkHref" value="${sysmenu.checkHref}" />
			</div>
		</div>
<!-- 		<div class="control-group"> -->
<!-- 			<label class="control-label">目标:</label> -->
<!-- 			<div class="controls"> -->
<%-- 				<pt:code name="target" category="5000" hasEmpty="false" default=""></pt:code> --%>
<!-- 			</div> -->
<!-- 		</div> -->
		<div class="control-group">
			<label class="control-label">菜单类型:</label>
			<div class="controls">
				<pt:code name="target" category="2000" hasEmpty="false" default="${sysmenu.menuType}"></pt:code>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">图标:</label>
			<div class="controls">
				<tags:iconselect id="icon" name="icon" value="${sysmenu.icon}"></tags:iconselect>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">排序:</label>
			<div class="controls">
				<input type="text" name="sort" value="${sysmenu.sort}" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">可见:</label>
			<div class="controls">
				<label class="radio-inline"> <input type="radio"
					name="isShow" id="slType1" value="1"
					${not empty sysmenu.isShow?(sysmenu.isShow=='1'?'checked':''):'checked'}>
					显示
				</label> <label class="radio-inline"> <input type="radio"
					name="isShow" id="slType0" value="0"
					${(sysmenu.isShow=='0')?'checked':''}> 隐藏
				</label>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">权限标识:</label>
			<div class="controls">
				<input type="text" name="permission" value="${sysmenu.permission}" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">标签:</label>
			<div class="controls">
				<input type="text" name="tag" value="${sysmenu.tag}" />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<input type="text" name="remark" value="${sysmenu.remark}" />
			</div>
		</div>
		<div class="form-actions">
			<sec:authorize ifAnyGranted="ROLE_sys_menu_edit">
			&nbsp; <input id="btnSubmit" class="btn btn-primary" type="submit"
				value="保 存" /> <input id="btnCancel" class="btn" type="button"
				value="返 回" onclick="toBack()" />
			</sec:authorize>
		</div>
	</form>
</body>
</html>